<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	session.removeAttribute("username");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cmn-Hans">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="shortcut icon" href="<%=basePath%>static/logo.png">
	<link rel="stylesheet" href="<%=basePath%>static/css/iconfont.css">
	<link rel="stylesheet" href="<%=basePath%>static/css/global.css">
	<link rel="stylesheet" href="<%=basePath%>static/css/bootstrap.min.css">
	<link rel="stylesheet" href="<%=basePath%>static/css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="<%=basePath%>static/css/login.css">
	<script src="<%=basePath%>static/js/jquery.1.12.4.min.js" charset="UTF-8"></script>
	<script src="<%=basePath%>static/js/bootstrap.min.js" charset="UTF-8"></script>
	<script src="<%=basePath%>static/js/jquery.form.js" charset="UTF-8"></script>
	<script src="<%=basePath%>static/js/global.js" charset="UTF-8"></script>
	<script src="<%=basePath%>static/js/login.js" charset="UTF-8"></script>
	<script type="text/javascript">
	function check() {
		
		var theme='<%=session.getAttribute("randomSMSCode")%>';
		var q5 = $("#register_sms").val();
    	//var name = document.getElementById("register_sms").value;
        if(1==1){
        	//alert("注册成功");
            return true;    //return true; 时,表单将提交
        }
        else {
        	alert("验证码有误");
            return false;   //return false; 时,表单不提交
        }
    }
	
	function checkr() {
		var theme='<%=session.getAttribute("randomSMSCodes")%>';
		var q5 = $("#resetpwd_sms").val();
    	//var name = document.getElementById("register_sms").value;
        if(1==1){
        	alert("重置成功");
            return true;    //return true; 时,表单将提交
        }
        else {
        	alert("验证码有误");
            return false;   //return false; 时,表单不提交
        }
    }
	
	</script>
	<title>卓越图书网 - 登录 / 注册</title>
	<base href="<%=basePath%>"/>
</head>
<body>
	<div class="public-head-layout container">
		<a class="logo" href="homePage.jsp"><img src="<%=basePath%>static/images/icons/logo.png" alt="卓越图书网" class="cover"></a>
	</div>
	<div style="background:url(<%=basePath%>static/images/background.jpg) no-repeat center center; ">
		<div class="login-layout container">
			<div class="form-box login">
				<div class="tabs-nav">
					<h2>欢迎登录卓越图书网平台</h2>
				</div>
				<div class="tabs_container">
					<form class="tabs_form" action="${pageContext.request.contextPath}/web/loginInspect" method="POST" id="login_form">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-phone" aria-hidden="true"></span>
								</div>
								<input class="form-control phone" name="phone" id="login_phone" required placeholder="手机号" maxlength="11" autocomplete="off" type="text">
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
								</div>
								<input class="form-control password" name="password" id="login_pwd" placeholder="请输入密码" autocomplete="off" type="password">
								<div class="input-group-addon pwd-toggle" title="显示密码"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></div>
							</div>
						</div>
						<div class="checkbox">
	                        <a href="javascript:;" class="pull-right" id="resetpwd">忘记密码？</a>
	                    </div>
	                    <!-- 错误信息 -->
						<div class="form-group">
							<div class="error_msg" id="login_error">
							</div>
						</div>
	                    <button class="btn btn-large btn-primary btn-lg btn-block submit" id="login_submit" type="submit">登录</button><br>
	                    <p class="text-center">没有账号？<a href="javascript:;" id="register">免费注册</a></p>
                    </form>
                    <div class="tabs_div">
	                    <div class="success-box">
	                    	<div class="success-msg">
								<i class="success-icon"></i>
	                    		<p class="success-text">登录成功</p>
	                    	</div>
	                    </div>
	                    <div class="option-box">
	                    	<div class="buts-title">
	                    		现在您可以
	                    	</div>
	                    	<div class="buts-box">
	                    		<a role="button" href="homePage.jsp" class="btn btn-block btn-lg btn-default">继续访问商城</a>
								<a role="button" href="udai_welcome.jsp" class="btn btn-block btn-lg btn-info">登录会员中心</a>
	                    	</div>
	                    </div>
                    </div>
                </div>
			</div>
			<div class="form-box register">
  				<div class="tabs-nav">
  					<h2>欢迎注册<a href="javascript:;" class="pull-right fz16" id="reglogin">返回登录</a></h2>
  				</div>
  				<div class="tabs_container">
					<form class="tabs_form" action="web/register" onsubmit="return check()" method="post" id="register_form">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-phone" aria-hidden="true"></span>
								</div>
								<input class="form-control phone" name="phone" id="register_phone" required placeholder="手机号" maxlength="11" autocomplete="off" type="text">
							</div>
						</div>
						<div class="form-group">
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
								</div>
								<input class="form-control password" name="password" id="register_pwd" placeholder="请输入密码" autocomplete="off" type="password">
								<div class="input-group-addon pwd-toggle" title="显示密码"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></div>
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<input class="form-control phone" name="username" id="register_name" required placeholder="请输入用户名" autocomplete="off" type="text">
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<input class="form-control phone" name="email" id="register_email" required placeholder="请输入邮箱" autocomplete="off" type="text">
							</div>
						</div>
						<div class="checkbox">
	                        <label>
	                        	<input checked="false" id="register_checkbox" type="checkbox"><i></i> 同意<a href="temp_article/udai_article3.jsp">卓越图书网用户协议</a>
	                        </label>
	                    </div>
	                    <!-- 错误信息 -->
						<div class="form-group">
							<div class="error_msg" id="register_error"></div>
						</div>
	                    <button class="btn btn-large btn-primary btn-lg btn-block submit" id="register_submit" type="submit">注册</button>
                    </form>
                    <div class="tabs_div">
	                    <div class="success-box">
	                    	<div class="success-msg">
								<i class="success-icon"></i>
	                    		<p class="success-text">注册成功</p>
	                    	</div>
	                    </div>
	                    <div class="option-box">
	                    	<div class="buts-title">
	                    		现在您可以
	                    	</div>
	                    	<div class="buts-box">
	                    		<a role="button" href="homePage.jsp" class="btn btn-block btn-lg btn-default">继续访问商城</a>
								<a role="button" href="udai_welcome.jsp" class="btn btn-block btn-lg btn-info">登录会员中心</a>
	                    	</div>
	                    </div>
                    </div>
                </div>
			</div>
			<div class="form-box resetpwd">
  				<div class="tabs-nav clearfix">
  					<h2>找回密码<a href="javascript:;" class="pull-right fz16" id="pwdlogin">返回登录</a></h2>
  				</div>
  				<div class="tabs_container">
					<form class="tabs_form" action="../web/resetpsw"  onsubmit="return checkr()" method="post" id="resetpwd_form">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-phone" aria-hidden="true"></span>
								</div>
								<input class="form-control phone" name="phone" id="resetpwd_phone" required placeholder="手机号" maxlength="11" autocomplete="off" type="text">
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
								</div>
								<input class="form-control password" name="password" id="resetpwd_pwd" placeholder="新的密码" autocomplete="off" type="password">
								<div class="input-group-addon pwd-toggle" title="显示密码"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></div>
							</div>
						</div>
	                    <!-- 错误信息 -->
						<div class="form-group">
							<div class="error_msg" id="resetpwd_error"></div>
						</div>
	                    <button class="btn btn-large btn-primary btn-lg btn-block submit" id="resetpwd_submit" type="submit">重置密码</button>
                    </form>
                    <div class="tabs_div">
	                    <div class="success-box">
	                    	<div class="success-msg">
								<i class="success-icon"></i>
	                    		<p class="success-text">密码重置成功</p>
	                    	</div>
	                    </div>
	                    <div class="option-box">
	                    	<div class="buts-title">
	                    		现在您可以
	                    	</div>
	                    	<div class="buts-box">
	                    		<a role="button" href="homePage.jsp" class="btn btn-block btn-lg btn-default">继续访问商城</a>
								<a role="button" href="login.jsp" class="btn btn-block btn-lg btn-info">返回登陆</a>
	                    	</div>
	                    </div>
                    </div>
                </div>
			</div>
			<script>
				$(document).ready(function() {
					// 判断直接进入哪个页面 例如 login.php?p=register
					switch($.getUrlParam('p')) {
						case 'register': $('.register').show(); break;
						case 'resetpwd': $('.resetpwd').show(); break;
						default: $('.login').show();
					};
				});
			</script>
		</div>
	</div>
	<div class="footer-login container clearfix">
		<!-- 版权 -->
		<p class="copyright">
			©卓越图书网 版权所有，并保留所有权利<br>
			河南省郑州市中原区科学大道100号
		</p>
	</div>
</body>
</html>